package ginput

import (
	"github.com/gin-gonic/gin"
	"message-center/pkg/gerrno"
	"net/http"
)

type Gin struct {
	C *gin.Context
}

// 绑定参数
func (g *Gin) ParamParse(data interface{}) (int, int) {
	err := g.C.Bind(&data)
	if err != nil {
		return http.StatusBadRequest, gerrno.INVALID_PARAMS
	}

	return http.StatusOK, gerrno.SUCCESS
}
